<template>
  <div>
    HelloWorld
    <button @click="num++">{{num}}</button>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        num:1
      }
    },
    // 生命周期钩子函数
    beforeCreate(){
      console.log('beforeCreate:组件创建前');
    },
    created(){
      console.log('created:组件创建完毕，此时数据可用，DOM不可用');
    },
    beforeMount(){
      console.log('beforeMount:Dom元素生成之前');
    },
    mounted(){
      console.log('Mount:Dom元素生成并展示到页面上');
    },
    beforeUpdate(){
      console.log('beforeUpdate:组件更新前');
    },
    updated(){
      console.log('updated更新完');
    },
    beforeDestroy(){
      console.log('beforeDestory：组件将要销毁');
    },
    destroyed(){
      console.log('destory：组件已销毁');
    }
  }
</script>

<style lang="scss" scoped>

</style>